/*     */ package com.bj58.analysis.tools.etl.bean;
/*     */ 
/*     */ import com.bj58.analysis.tools.common.TrackUrlUtils;
/*     */ import com.bj58.analysis.tools.common.bean.LogBean;
/*     */ import java.util.regex.Matcher;
/*     */ import java.util.regex.Pattern;
/*     */ import net.sf.json.JSONObject;
/*     */ import org.apache.commons.lang.StringUtils;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class ETLTrackBean
/*     */   implements LogBean
/*     */ {
/*  16 */   private String cookieID = "";
/*  17 */   private String catePath = "";
/*  18 */   private String areaPath = "";
/*  19 */   private String url = "";
/*  20 */   private String epoch = "";
/*  21 */   private String userIp = "";
/*  22 */   private String siteName = "";
/*  23 */   private String pageVersion = "";
/*  24 */   private String loginUid = "";
/*  25 */   private String postCount = "";
/*  26 */   private String outKWord = "";
/*  27 */   private String pageType = "";
/*  28 */   private String refDomain = "";
/*  29 */   private String windowSize = "";
/*  30 */   private String referrer = "";
/*  31 */   private String infoUid = "";
/*  32 */   private String pm58 = "";
/*  33 */   private String inKWord = "";
/*  34 */   private String loadTime = "";
/*  35 */   private String status = "";
/*  36 */   private String trackUrl = "";
/*  37 */   private String supplyCount = "";
/*  38 */   private String busine = "";
/*  39 */   private String gautma = "";
/*  40 */   private String unitParams = "";
/*  41 */   private String queryParams = "";
/*  42 */   private String userAgent = "";
/*  43 */   private String bizName_New = "";
/*  44 */   private String sessionId = "";
/*     */   
/*     */   public String getCookieID() {
/*  47 */     return this.cookieID;
/*     */   }
/*     */   
/*     */   public void setCookieID(String cookieID) {
/*  51 */     this.cookieID = cookieID;
/*     */   }
/*     */   
/*     */   public String getCatePath() {
/*  55 */     return this.catePath;
/*     */   }
/*     */   
/*     */   public void setCatePath(String catePath) {
/*  59 */     this.catePath = catePath;
/*     */   }
/*     */   
/*     */   public String getAreaPath() {
/*  63 */     return this.areaPath;
/*     */   }
/*     */   
/*     */   public void setAreaPath(String areaPath) {
/*  67 */     this.areaPath = areaPath;
/*     */   }
/*     */   
/*     */   public String getUrl() {
/*  71 */     return this.url;
/*     */   }
/*     */   
/*     */   public void setUrl(String url) {
/*  75 */     this.url = url;
/*     */   }
/*     */   
/*     */   public String getEpoch() {
/*  79 */     return this.epoch;
/*     */   }
/*     */   
/*     */   public void setEpoch(String epoch) {
/*  83 */     this.epoch = epoch;
/*     */   }
/*     */   
/*     */   public String getUserIp() {
/*  87 */     return this.userIp;
/*     */   }
/*     */   
/*     */   public void setUserIp(String userIp) {
/*  91 */     this.userIp = userIp;
/*     */   }
/*     */   
/*     */   public String getSiteName() {
/*  95 */     return this.siteName;
/*     */   }
/*     */   
/*     */   public void setSiteName(String siteName) {
/*  99 */     this.siteName = siteName;
/*     */   }
/*     */   
/*     */   public String getPageVersion() {
/* 103 */     return this.pageVersion;
/*     */   }
/*     */   
/*     */   public void setPageVersion(String pageVersion) {
/* 107 */     this.pageVersion = pageVersion;
/*     */   }
/*     */   
/*     */   public String getLoginUid() {
/* 111 */     return this.loginUid;
/*     */   }
/*     */   
/*     */   public void setLoginUid(String loginUid) {
/* 115 */     this.loginUid = loginUid;
/*     */   }
/*     */   
/*     */   public String getPostCount() {
/* 119 */     return this.postCount;
/*     */   }
/*     */   
/*     */   public void setPostCount(String postCount) {
/* 123 */     this.postCount = postCount;
/*     */   }
/*     */   
/*     */   public String getOutKWord() {
/* 127 */     return this.outKWord;
/*     */   }
/*     */   
/*     */   public void setOutKWord(String outKWord) {
/* 131 */     this.outKWord = outKWord;
/*     */   }
/*     */   
/*     */   public String getPageType() {
/* 135 */     return this.pageType;
/*     */   }
/*     */   
/*     */   public void setPageType(String pageType) {
/* 139 */     this.pageType = pageType;
/*     */   }
/*     */   
/*     */   public String getRefDomain() {
/* 143 */     return this.refDomain;
/*     */   }
/*     */   
/*     */   public void setRefDomain(String refDomain) {
/* 147 */     this.refDomain = refDomain;
/*     */   }
/*     */   
/*     */   public String getWindowSize() {
/* 151 */     return this.windowSize;
/*     */   }
/*     */   
/*     */   public void setWindowSize(String windowSize) {
/* 155 */     this.windowSize = windowSize;
/*     */   }
/*     */   
/*     */   public String getReferrer() {
/* 159 */     return this.referrer;
/*     */   }
/*     */   
/*     */   public void setReferrer(String referrer) {
/* 163 */     this.referrer = referrer;
/*     */   }
/*     */   
/*     */   public String getInfoUid() {
/* 167 */     return this.infoUid;
/*     */   }
/*     */   
/*     */   public void setInfoUid(String infoUid) {
/* 171 */     this.infoUid = infoUid;
/*     */   }
/*     */   
/*     */   public String getPm58() {
/* 175 */     return this.pm58;
/*     */   }
/*     */   
/*     */   public void setPm58(String pm58) {
/* 179 */     this.pm58 = pm58;
/*     */   }
/*     */   
/*     */   public String getInKWord() {
/* 183 */     return this.inKWord;
/*     */   }
/*     */   
/*     */   public void setInKWord(String inKWord) {
/* 187 */     this.inKWord = inKWord;
/*     */   }
/*     */   
/*     */   public String getLoadTime() {
/* 191 */     return this.loadTime;
/*     */   }
/*     */   
/*     */   public void setLoadTime(String loadTime) {
/* 195 */     this.loadTime = loadTime;
/*     */   }
/*     */   
/*     */   public String getStatus() {
/* 199 */     return this.status;
/*     */   }
/*     */   
/*     */   public void setStatus(String status) {
/* 203 */     this.status = status;
/*     */   }
/*     */   
/*     */   public String getTrackUrl() {
/* 207 */     return this.trackUrl;
/*     */   }
/*     */   
/*     */   public void setTrackUrl(String trackUrl) {
/* 211 */     this.trackUrl = trackUrl;
/*     */   }
/*     */   
/*     */   public String getSupplyCount() {
/* 215 */     return this.supplyCount;
/*     */   }
/*     */   
/*     */   public void setSupplyCount(String supplyCount) {
/* 219 */     this.supplyCount = supplyCount;
/*     */   }
/*     */   
/*     */   public String getBusine() {
/* 223 */     return this.busine;
/*     */   }
/*     */   
/*     */   public void setBusine(String busine) {
/* 227 */     this.busine = busine;
/*     */   }
/*     */   
/*     */   public String getGautma() {
/* 231 */     return this.gautma;
/*     */   }
/*     */   
/*     */   public void setGautma(String gautma) {
/* 235 */     this.gautma = gautma;
/*     */   }
/*     */   
/*     */   public String getUnitParams() {
/* 239 */     return this.unitParams;
/*     */   }
/*     */   
/*     */   public void setUnitParams(String unitParams) {
/* 243 */     this.unitParams = unitParams;
/*     */   }
/*     */   
/*     */   public String getQueryParams() {
/* 247 */     return this.queryParams;
/*     */   }
/*     */   
/*     */   public void setQueryParams(String queryParams) {
/* 251 */     this.queryParams = queryParams;
/*     */   }
/*     */   
/*     */   public String getUserAgent() {
/* 255 */     return this.userAgent;
/*     */   }
/*     */   
/*     */   public void setUserAgent(String userAgent) {
/* 259 */     this.userAgent = userAgent;
/*     */   }
/*     */   
/*     */   public String getBizName_New() {
/* 263 */     return this.bizName_New;
/*     */   }
/*     */   
/*     */   public void setBizName_New(String bizName_New) {
/* 267 */     this.bizName_New = bizName_New;
/*     */   }
/*     */   
/*     */   public String getSessionId() {
/* 271 */     return this.sessionId;
/*     */   }
/*     */   
/*     */   public void setSessionId(String sessionId) {
/* 275 */     this.sessionId = sessionId;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public String getInfoId()
/*     */   {
/* 283 */     return getMessageByTrackURL("infoid");
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public String getGTID()
/*     */   {
/* 291 */     return getMessageByTrackURL("GTID");
/*     */   }
/*     */   
/*     */   private String getMessageByTrackURL(String name)
/*     */   {
/* 296 */     String value = null;
/* 297 */     String trackUrl = getTrackUrl();
/* 298 */     trackUrl = TrackUrlUtils.formatTrackUrl(trackUrl);
/* 299 */     if (StringUtils.isNotBlank(trackUrl))
/*     */     {
/* 301 */       JSONObject jsonObj = null;
/*     */       try {
/* 303 */         jsonObj = JSONObject.fromObject(trackUrl);
/*     */       }
/*     */       catch (Exception e) {}
/*     */       
/* 307 */       if ((jsonObj != null) && 
/* 308 */         (jsonObj.containsKey(name))) {
/* 309 */         value = jsonObj.getString(name);
/*     */       }
/*     */     }
/*     */     
/* 313 */     return value;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public String getPGTID()
/*     */   {
/* 321 */     String url = getUrl();
/* 322 */     String pattern = "(PGTID=)[^&]+(&)*+";
/* 323 */     Pattern p_a = Pattern.compile(pattern, 2);
/* 324 */     Matcher m_a = p_a.matcher(url);
/* 325 */     while (m_a.find()) {
/* 326 */       String a = m_a.group();
/* 327 */       if (a.contains("&")) {
/* 328 */         a = a.substring(0, a.length() - 1);
/*     */       }
/* 330 */       String[] pgid = a.split("=", -1);
/* 331 */       if (pgid.length >= 2) {
/* 332 */         String value = pgid[1].trim();
/* 333 */         return value;
/*     */       }
/*     */     }
/* 336 */     return null;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public String getCatePathOfLevel(int level)
/*     */   {
/* 346 */     String tu = getCatePath();
/* 347 */     return parserClassType(tu, level);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public String getAreaPathOfLevel(int level)
/*     */   {
/* 357 */     String ta = getAreaPath();
/* 358 */     return parserClassType(ta, level);
/*     */   }
/*     */   
/*     */   private String parserClassType(String src, int index)
/*     */   {
/* 363 */     String result = null;
/* 364 */     if (index == 0) {
/* 365 */       return result;
/*     */     }
/* 367 */     if (StringUtils.isNotBlank(src)) {
/* 368 */       String[] srcS = src.split(",", -1);
/* 369 */       if (srcS.length > index) {
/* 370 */         result = srcS[index];
/*     */       }
/*     */     }
/* 373 */     return result;
/*     */   }
/*     */   
/*     */   public String toString()
/*     */   {
/* 378 */     return this.cookieID + "\001" + this.catePath + "\001" + this.areaPath + "\001" + this.url + "\001" + this.epoch + "\001" + this.userIp + "\001" + this.siteName + "\001" + this.pageVersion + "\001" + this.loginUid + "\001" + this.postCount + "\001" + this.outKWord + "\001" + this.pageType + "\001" + this.refDomain + "\001" + this.windowSize + "\001" + this.referrer + "\001" + this.infoUid + "\001" + this.pm58 + "\001" + this.inKWord + "\001" + this.loadTime + "\001" + this.status + "\001" + this.trackUrl + "\001" + this.supplyCount + "\001" + this.busine + "\001" + this.gautma + "\001" + this.unitParams + "\001" + this.queryParams + "\001" + this.userAgent + "\001" + this.bizName_New + "\001" + this.sessionId;
/*     */   }
/*     */ }


/* Location:              C:\Users\zhaoxiang\Desktop\basestat_log_common_tools-0.3.jar!\com\bj58\analysis\tools\etl\bean\ETLTrackBean.class
 * Java compiler version: 5 (49.0)
 * JD-Core Version:       0.7.1
 */